// 做表单校验的
const joi = require('@hapi/joi')
// 验证规则
const username = joi.string().alphanum().min(1).max(10).required()
const password = joi.string().pattern(/^[\S]{6,12}$/).required()
const id = joi.number().integer().min(1).required() 
const nickname = joi.string().required()
const email = joi.string().email().required()

module.exports.reg_login_schema = {
    body: {
        username:username,
        password:password
    }
}

module.exports.update_userinfo_schema = {
    body: { 
      id: id, // key是要校验的属性 value是校验的规则
      nickname: nickname,
      email: email
    }
  }